package org.cainiao.basic.concurrent.juc.aqs.countdownlatch;

import org.cainiao.util.Util;

import java.util.concurrent.CountDownLatch;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class CountDownLatchTest {

    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(4);

        CountDownLatchRunnable.newThread("T1", 1, countDownLatch).start();
        CountDownLatchRunnable.newThread("T2", 2, countDownLatch).start();
        CountDownLatchRunnable.newThread("T3", 3, countDownLatch).start();
        CountDownLatchRunnable.newThread("T4", 3, countDownLatch).start();

        countDownLatch.await();
        Util.logLn("main end");
    }
}
